package com.atguigu.exer;

public class ThreadDemo_01 {
    public static void main(String[] args) {
        HelloThread helloThread=new HelloThread();
        helloThread.setName("可爱捏");
        helloThread.start();
        helloThread.setPriority(Thread.MAX_PRIORITY);
        //给主线程命名:
        Thread.currentThread().setName("珈乐carol");
        Thread.currentThread().setPriority(1);
        for(int i=0;i<100;i++){
            System.out.println(Thread.currentThread().getName()+"***"+Thread.currentThread().getPriority()+" **"+i);
        }
    }
}
class HelloThread extends Thread{
    @Override
    public void run() {
        for(int i=0;i<=100;i++){
            if((i&1)==0){
                System.out.println(Thread.currentThread().getName()+":  *** "+Thread.currentThread().getPriority()+"***"+i);
            }
        }
    }
}
